const r = require('../utils/request.js')
const getPhoneInfo = function (data) {
  return r.request({
    url: '/wxUser/getPhoneNumber',
    method: 'GET',
    data
  })
}
const getUserInfo = function (data) {
  return r.request({
    url: '/wxUser/getUserInfo',
    method: 'GET',
    data
  })
}
const getUnReadMessageCount = function (data) {
  return r.request({
    url: '/publish/getUnReadMessageCount',
    method: 'GET',
    data: data
  })
}
const deletePublish = function (data) {
  return r.request({
    url: '/publish/deletePublish',
    method: 'GET',
    data: data
  })
}
const getListFollow = function (data) {
  return r.request({
    url: '/wxUser/listFollow',
    method: 'GET',
    data: data
  })
}
const listFollowed = function (data) {
  return r.request({
    url: '/wxUser/listFollowed',
    method: 'GET',
    data: data
  })
}
const listFriend = function (data) {
  return r.request({
    url: '/wxUser/listFriend',
    method: 'GET',
    data: data
  })
}
const listAward = function (data) {
  return r.request({
    url: '/publish/listAward',
    method: 'GET',
    data: data
  })
}
const listAwarded = function (data) {
  return r.request({
    url: '/publish/listAwarded',
    method: 'GET',
    data: data
  })
}
const getPersonalCard = function (data) {
  return r.request({
    url: '/wxUser/getPersonalCard',
    method: 'GET',
    data
  })
}
const getSignature = function (data) {
  return r.request({
    url: '/wxUser/getSignature',
    method: 'GET',
    data
  })
}
const getListPublish = function (data) {
  return r.request({
    url: '/publish/listPublish',
    method: 'GET',
    data: data
  })
}
const getEnterpriseCard = function (data) {
  return r.request({
    url: '/wxUser/getEnterpriseCard',
    method: 'GET',
    data: data
  })
}
const listMessage = function (data) {
  return r.request({
    url: '/publish/listMessage',
    method: 'GET',
    data
  })
}
const addFollow = function (data) {
  return r.request({
    url: '/wxUser/addFollow',
    method: 'POST',
    data: data
  })
}
const saveEnterpriseCard = function (data) {
  return r.request({
    url: '/wxUser/saveEnterpriseCard',
    method: 'POST',
    data: data
  })
}
const savePersonalCard = function (data) {
  return r.request({
    url: '/wxUser/savePersonalCard',
    method: 'POST',
    data: data
  })
}
const cancelFollow = function (data) {
  return r.request({
    url: '/wxUser/cancelFollow',
    method: 'POST',
    data: data
  })
}
const updateInfo = function (data) {
  return r.request({
    url: '/wxUser/update',
    method: 'POST',
    data: data
  })
}
const uploadFile = function (data) {
  return r.request({
    url: '/system/oss/upload',
    method: 'POST',
    data: data,
    header: {
      'content-type': 'multipart/form-data',
      Authorization: wx.getStorageSync('loginInfo').Authorization
    }
  })
}

module.exports = {
  getUserInfo,
  getListFollow,
  addFollow,
  cancelFollow,
  updateInfo,
  uploadFile,
  getPersonalCard,
  getSignature,
  savePersonalCard,
  getListPublish,
  getEnterpriseCard,
  getUnReadMessageCount,
  deletePublish,
  saveEnterpriseCard,
  listFriend,
  listFollowed,
  listMessage,
  listAward,
  listAwarded,
  getPhoneInfo
}
